<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>背景图平铺方式</title>
    <style>
        /* 盒子大小 800*800 */
        .box-norepeat{
            width: 800px;
            height: 800px;
            background-image: url(img/img01.jpg);
            background-repeat: no-repeat;
            background-color: pink;
            color: gray;
        }
        .box-repeat{
            width: 800px;
            height: 800px;
            background-image: url(img/img01.jpg);
            background-repeat: repeat;
            background-color: pink;
            color: gray;
        }
        .box-repeat-x{
            width: 800px;
            height: 800px;
            background-image: url(img/img01.jpg);
            background-repeat: repeat-x;
            background-color: pink;
            color: gray;
        }
        .box-repeat-y{
            width: 800px;
            height: 800px;
            background-image: url(img/img01.jpg);
            background-repeat: repeat-y;
            background-color: pink;
            color: gray;
        }
    </style>
</head>
<body>
    <div class="box-norepeat"> 背景图不平铺 </div>
    <br>
    <div class="box-repeat"> 背景图平铺 </div>
    <br>
    <div class="box-repeat-x"> 背景图水平平铺 </div>
    <br>
    <div class="box-repeat-y"> 背景图垂直平铺 </div>
</body>
</html>